package createModel.BuilderModel.directorBuilderPlayers02;
import java.math.BigDecimal;
import java.util.Date;
import java.util.ArrayList;

import createModel.BuilderModel.directorBuilderPlayers02.convert.BasicConfigDtoConvertBasicConfig;
import createModel.BuilderModel.directorBuilderPlayers02.pojo.BasicConfigDto;

public class Client {
    public static void main(String[] args) {
        try {
            BasicConfigAutomaticBuilder basicConfigAutomaticBuilder = new BasicConfigAutomaticBuilder();
            Director director = new Director();
            director.setBuilder(basicConfigAutomaticBuilder);

            BasicConfigManualBuilder basicConfigManualBuilder = new BasicConfigManualBuilder();
            director.setBuilder(basicConfigManualBuilder);

            BasicConfigDto basicConfigDto = new BasicConfigDto();
            basicConfigDto.setId(0L);
            basicConfigDto.setReductionEmissionFactorId("23");
            basicConfigDto.setFactorLibraryId("1");
            basicConfigDto.setEmissionFactorName("12");
            ArrayList<String> ghgTypeCode = new ArrayList<>();
            ghgTypeCode.add("1");
            basicConfigDto.setGhgTypeCode(ghgTypeCode);
            basicConfigDto.setDataValue(new BigDecimal("0"));
            basicConfigDto.setFactorGrade("1");
            basicConfigDto.setMolecularUnit("123");
            basicConfigDto.setDenominatorUnit("123");
            basicConfigDto.setUpdateAt(new Date());
            BasicConfig basicConfig = director.createBasicConfig(new BasicConfigDtoConvertBasicConfig(),
                                                                 basicConfigDto);
            System.out.println(basicConfig);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
